using System;
using System.Collections.Generic;
using System.Text;

namespace Barbar.MapReport.PolygonReducer {
  internal class Vector {
    private decimal m_X, m_Y, m_Z;

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
    public decimal X {
      get { return m_X; }
      set { m_X = value; }
    }

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
    public decimal Y {
      get { return m_Y; }
      set { m_Y = value; }
    }

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
    public decimal Z {
      get { return m_Z; }
      set { m_Z = value; }
    }

    public Vector(decimal x, decimal y, decimal z) {
      m_X = x;
      m_Y = y;
      m_Z = z;
    }

    public decimal Dot(Vector v) {
      return this.X * v.X + this.Y * v.Y + this.Z * v.Z;
    }

    public static Vector operator -(Vector a, Vector b) {
      return new Vector(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
    }

    public static Vector operator *(Vector a, decimal size) {
      return new Vector(a.X * size, a.Y * size, a.Z * size);
    }
  }
}
